package com.mc.lab.service.impl;

import java.util.List;
import com.mc.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mc.lab.mapper.LabQualificationMapper;
import com.mc.lab.domain.LabQualification;
import com.mc.lab.service.ILabQualificationService;

/**
 * 实验室资质 Service业务层处理
 *
 * @author mc
 * @date 2021-03-18
 */
@Service
public class LabQualificationServiceImpl implements ILabQualificationService
{
    @Autowired
    private LabQualificationMapper labQualificationMapper;

    /**
     * 查询实验室资质
     *
     * @param id 实验室资质 ID
     * @return 实验室资质
     */
    @Override
    public LabQualification selectLabQualificationById(Long id)
    {
        return labQualificationMapper.selectLabQualificationById(id);
    }

    /**
     * 查询实验室资质 列表
     *
     * @param labQualification 实验室资质
     * @return 实验室资质
     */
    @Override
    public List<LabQualification> selectLabQualificationList(LabQualification labQualification)
    {
        return labQualificationMapper.selectLabQualificationList(labQualification);
    }

    /**
     * 新增实验室资质
     *
     * @param labQualification 实验室资质
     * @return 结果
     */
    @Override
    public int insertLabQualification(LabQualification labQualification)
    {
        labQualification.setCreateTime(DateUtils.getNowDate());
        return labQualificationMapper.insertLabQualification(labQualification);
    }

    /**
     * 修改实验室资质
     *
     * @param labQualification 实验室资质
     * @return 结果
     */
    @Override
    public int updateLabQualification(LabQualification labQualification)
    {
        labQualification.setUpdateTime(DateUtils.getNowDate());
        return labQualificationMapper.updateLabQualification(labQualification);
    }

    /**
     * 批量删除实验室资质
     *
     * @param ids 需要删除的实验室资质 ID
     * @return 结果
     */
    @Override
    public int deleteLabQualificationByIds(Long[] ids)
    {
        return labQualificationMapper.deleteLabQualificationByIds(ids);
    }

    /**
     * 删除实验室资质 信息
     *
     * @param id 实验室资质 ID
     * @return 结果
     */
    @Override
    public int deleteLabQualificationById(Long id)
    {
        return labQualificationMapper.deleteLabQualificationById(id);
    }
}